package com.guaju.yueshangclothing.bean;

import android.databinding.BaseObservable;
import android.databinding.BindingAdapter;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.guaju.yueshangclothing.R;

import java.util.ArrayList;

/**
 * Created by guaju on 2018/9/29.
 */

public class Goods extends BaseObservable {
    String icon;
    String title;
    ArrayList<String> tag;
    float price;

    public Goods() {
        this.title="测试标题测试标题测试标题测试标题测试标题测试标题";
        this.price=123.45f;
    }

    public Goods(String icon, String title, ArrayList<String> tag, float price) {
        this.icon = icon;
        this.title = title;
        this.tag = tag;
        this.price = price;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public ArrayList<String> getTag() {
        return tag;
    }

    public void setTag(ArrayList<String> tag) {
        this.tag = tag;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }
    @BindingAdapter("app:img")
    public static void  setImg(ImageView iv,String url){
        Glide.with(iv.getContext()).load(url).placeholder(R.mipmap.ic_launcher).error(R.mipmap.goods).into(iv);
    }
}
